package com.atguigu.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import io.lettuce.core.protocol.DemandAware;

import java.util.Map;

/**
 * @author Summerday
 */
public class ExcelListener extends AnalysisEventListener<DemoData> {

    //一行一行读取excel的内容
    @Override
    public void invoke(DemoData data, AnalysisContext analysisContext) {
        System.out.println("data  ==>"+data);
    }

    //读取表头
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        super.invokeHeadMap(headMap, context);
        System.out.println("header==>"+headMap);
    }

    //读取完成之后
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
